package task1;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 东莞呵呵
 * Date:2022-05-11
 * Time:19:35
 */
public class TestDemo6 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int[] arr={2,4,6,8,10,12,14,16};
        int left=0;
        int right=arr.length-1;
        int mid=(left+right)/2;
        int n= scanner.nextInt();
        while(left<right){
           if(arr[mid]>n){
               right=mid;
               mid=(left+right)/2;
           }else if(arr[mid]<n){
               left=mid;
               mid=(left+right)/2;
           }else{
               System.out.println("所找元素的下标是"+mid);
               break;
           }
        }
    }
}
